//
//  BRInviteHeaderView.m
//  BrezzeSaaS
//
//  Created by IOS on 2022/1/19.
//  Copyright © 2022 Brezze GWG. All rights reserved.
//

#import "BRInviteHeaderView.h"

@implementation BRInviteHeaderView


- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setUI];
    }
    return self;
}

//- (void)toAbout {
//    
//    if (self.toAboutBlock) self.toAboutBlock();
//}


- (void)setUI {
//    self.layer.cornerRadius = 33;
    self.backgroundColor = UIColorClear;
    
    UIImage *bgImg = UIImageMake(@"invite_banner");
    UIImageView *img = [[UIImageView alloc] initWithImage:bgImg];
    [self addSubview:img];
    CGFloat img_h = kScale414(210);
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self);
        make.height.mas_equalTo(img_h);
        make.top.offset(14);
        make.bottom.offset(0);
    }];
    
    NSString *text1 = Localized(@"invite_title");
    NSString *text2 = Localized(@"invite_getReward");
    text1 = [NSString stringWithFormat:@"%@%@",text1,text2];
    QMUILabel *titleL = [BRToolsView br_label:text1 textColor:kColorTitle999 font:[UIFont fontR:20]];
    titleL.numberOfLines = 0;
    titleL.attributedText = [BRStringTools br_att:text1 rang:NSMakeRange(text1.length - text2.length, text2.length) textC:kColorTitle38 font:[UIFont fontS:20]];
    [self addSubview:titleL];
    [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(28);
        make.top.equalTo(img.mas_top).offset(44);
        make.width.mas_equalTo(144);
    }];
    
//    QMUIButton *abBtn = [[QMUIButton alloc] init];
//    [abBtn setTitle:Localized(@"invite_aboutReferral") forState:UIControlStateNormal];
//    [abBtn setImage:UIImageMake(@"arrow_right_green6") forState:UIControlStateNormal];
//    abBtn.titleLabel.font = [UIFont fontM:14];
//    [abBtn setTitleColor:kColorMain forState:UIControlStateNormal];
//    abBtn.imagePosition = QMUIButtonImagePositionRight;
//    abBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 6, 0, 0);
//    
//    [self addSubview:abBtn];
//    [abBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.height.mas_equalTo(44);
//        make.centerX.offset(0);
//        make.bottom.offset(0);
//    }];
//    
//    [abBtn addTarget:self action:@selector(toAbout) forControlEvents:UIControlEventTouchUpInside];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
